package com.practice.stream.entity;

import lombok.*;

import java.util.Objects;

/**
 * 交易员
 *
 * @author hd
 * @date 2022/1/29 16:31
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Trader {
    private String name;
    private String location;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Trader trader = (Trader) o;
        return Objects.equals(name, trader.name) && Objects.equals(location, trader.location);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, location);
    }
}
